/*
 * Game.java
 *
 * Created on 25 mai 2007, 11:45
 */

package devintgame;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 *
 * @author  gaby
 */
public class Game_1 extends javax.swing.JFrame {
    JFrame me;
    Controler controler;
    /** Creates new form Game */
    public Game_1(boolean alone) {
        me = this;
        
        this.setPreferredSize(new Dimension (800,600));
        this.setLayout(new BorderLayout());
        
        controler = new Controler (this);
        
        JPanel gamePanel = controler.getGamePanel();
        JPanel scorePanel = controler.getScorePanel();
        
        /** Game panel */
        /*gamePanel.addMouseListener(new MouseListener(){
            public void mouseClicked(MouseEvent mouseEvent) {
                mouseEvent.getComponent().requestFocusInWindow();
            }

            public void mousePressed(MouseEvent mouseEvent) {
            }

            public void mouseReleased(MouseEvent mouseEvent) {
            }

            public void mouseEntered(MouseEvent mouseEvent) {
            }

            public void mouseExited(MouseEvent mouseEvent) {
            }
            
        });*/
        /*
        });*/
        this.add (scorePanel, BorderLayout.WEST);
        this.add (gamePanel, BorderLayout.CENTER);
        
        if (alone)
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        else
            this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        
        this.pack();
        this.setVisible(true);
        
        
        
    }
    
    public void paint (Graphics g){
        super.paint(g);
        
        System.out.println ("Paint game 1");
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        new Game_1(true);
        //Controler pan = new Controler(game);
        //game.add(pan);
        //game.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //game.setVisible(true);
        
        
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    // End of variables declaration//GEN-END:variables
    
}
